Driven by increasing usage of a variety of network applications, such as those involving the Internet, computer networks are of increasing interest. FIG. 1 depicts conventional computer networks 1 and 15 coupled via the Internet 14. The conventional computer network 1 includes router 2, clients 4, and 6 and servers 8, 10 and 12. The conventional computer network 15 includes router 16, clients 18, 20 and 22 and server 24. The conventional computer networks 1 and 15 may also have other constituents, including other computer systems and/or additional routers, that are not shown for clarity.
The components of the computer networks 1 and 15 may desire to communicate, for example through the Internet 14. For example, a client 2 may communicate with the server 24. Similarly, the client 18 may communicate with the server 8. In order to do so, a session is established between computer systems. In the session, data packets are sent between the computer systems involved in the session. Each packet is associated with a source from which the packet originates and a destination to which the packet is to be sent. Thus the source and destination are each one of the computer systems 4, 6, 8, 10, 12, 18, 20, 22 or 24. Each packet includes information relating to the computer systems involved in the session, typically in an IP five-tuple, that is used to route the packet to the appropriate computer system.
FIG. 2 is a block diagram depicting an IP five-tuple 30. The IP five-tuple 30 is taken from various fields in an IP header and TCP header of a packet. The IP five-tuple 30 includes five fields, the protocol 32, two source fields 34 and 36 and two destination fields 38 and 40. The source fields are the source address 34 and the source port 36. The destination fields are the destination address 38 and the destination port 40. The source address 34 is typically the IP address of the source. The source port 36 and destination port 40 are associated with the software application connected to the TCP protocol layer. The destination address 39 is typically the IP address of the destination for the packet.
In a session, each computer system involved in the session sends packets to the other computer system involved in the session. Thus, packets for a session travel in two directions, to and from each computer system. The destination for a packet traveling in one direction is the source for a packet traveling in the opposite direction. For example, suppose a session is established between the client 4 and the client 20. For a packet traveling from the client 4 to the client 20, the source is the client 4 and the destination is the client 20. However, for a packet traveling from the client 20 to the client 4, the source is the client 20 and the destination is the client 4. Thus, for a particular session, different packets may have the source fields 34 and 36 and the destination fields 38 and 40 interchanged.
In order to keep track of the ongoing sessions and store information used in routing packets for the sessions, a session table is typically used. FIG. 3 depicts a conventional session table 50. The conventional session table 50 is typically kept by a router, such as the routers 2 and 16. The conventional session table 50 includes a plurality of entries. For clarity, only four entries 52, 54, 56 and 58 are marked. Each of the entries 52, 54, 56 and 58 includes data for a corresponding session. This data is used to forward packets for the session to the appropriate destination using the appropriate ports. The conventional session table 50 includes two entries for each session. Thus, the entries 52 and 54 relate to one session, while the entries 56 and 58 relate to another session. The entries 52, 54, 56 and 58 are indexed using a concatenation of the protocol 32, source address 34, source port 36, destination address 38 and destination port 40. The concatenation of the protocol 32, source address 34, source port 36, destination address 38 and destination port 40 is typically hashed in order to provide the index for the session.
FIG. 4 depicts a conventional method 60 for accessing information for a particular packet related to a particular session in the conventional session table 50. The conventional method 60 utilizes an IP five-tuple. Thus, the conventional method will thus be described in conjunction with FIGS. 2 and 3. A key is obtained by concatenating the fields 32, 34, 36, 38 and 40 of the IP five-tuple for the packet, via step 62. The protocol 32, source address 34, source port 36, destination address 38 and destination port 40 are concatenated in a particular order to form the key. The key is then used to search the session table 50 for the index which matches the key, via step 64. Step 64 typically includes applying a hash function to the concatenation of the protocol 32, the source address 34, source port 36, destination address 38 and destination port 40 and searching for the index which matches this hash. In addition, step 64 may require collision resolution for cases where multiple entries index into the same entry in the table 50. In other words, collision resolution is used where the same index, or key, results from applying the hash function to two different search keys. Step 64 results in the index for the entry containing data relating to the session of interest. Once the index is obtained, the data in the corresponding entry is accessed, via step 66. Using the data in the entry, the packet can be forwarded or otherwise manipulated in accordance with the information in the entry for the session and session state information can be updated as required.
Although the conventional session table 50 and the conventional method 60 allow the packets for the session to be forwarded to the destination, one of ordinary skill in the art will readily recognize that the method 60 and the conventional session table 50 are inefficient. The conventional session table 50 includes two entries 52 and 54 or 56 and 58 for each session. One entry is for packets traveling in one direction, while the second entry is for packets traveling in the opposite direction. For example, if a session is established between the client 6 and the server 24, packets can travel from the client 6 to the server 24 and from the server 24 to the client 6. The source fields 34 and 36 and the destination fields 38 and 40 of packets traveling from the client 6 to the server 24 are the destination fields and the source fields of packet traveling form the server 24 to the client 6. Thus, a concatenation of the source and destination fields for a packet traveling in one direction is different from a concatenation of the source and destination fields for a packet traveling in the opposite direction. Consequently, the index for the session differs slightly depending upon the direction of travel of the packets. Thus, the conventional session table 50 must include two entries 52 and 54 for each session. Moreover, a large number of sessions are typically occurring at a particular time. Thus, the conventional session table 50 consumes a large amount of memory. Furthermore, the sessions that are ongoing change relatively rapidly. Thus, the conventional session table must be updated with insertions for new sessions and deletions for completed sessions. Because two entries 52 and 54 are required for each session, each new session requires two insertions. Similarly, the completion of each session requires two deletions. Session state information must also be duplicated. These operations consume resources of the router 2 or 16. Thus, upkeep of the conventional session table 50 may be more time consuming and require more resources than desired.
Accordingly, what is needed is a system and method for more efficiently identifying sessions. The present invention addresses such a need.